import 'package:base_flutter/base_flutter.dart';
import 'package:ls_work/net/post_request.dart';

import '../../net/api/http_api.dart';
import '../../net/response/food/send_food_table_data.dart';

abstract class ISendFoodTableData{

  String iRoomName = "";
  String iOldName = "";
  String iBreakfast = "";
  String iLaunch = "";
  String iDinner = "";

}




class SendFoodModel extends BaseMvvmModel{
  @override
  void onCleared() {
  }

  Future<List<SendFoodTableData>> getSendFood(dynamic buildingId,dynamic floorId,String useDate,{int start = 0,int row = 20}) async {
    var map = <String,dynamic>{
      "buildingId":buildingId,
      "floorId":floorId,
      "useDate":useDate,

    }.toJsonMapStr();
    map["page"] = start;
    map["row"] = row;
    var data = await HttpGo.instance.postData(BookFoodApis.sendFoodTable,data: map,options: PostRequest.urlencodedHeader);
    if ("0" == data["code"]) {
      var list = ((data['data']['rows'] as List?)??[])
          .map((e) => SendFoodTableData.fromJson(e))
          .toList();
      return list;
    } else {
      throw data['msg'];
    }
  }


}